<#import "/spring.ftl" as spring />
<html>
<head>
	<title>inspection</title>
	
	<#-- so freemarker will print out currency correctly -->
	<#setting locale="en_US">
	
	<script type="text/javascript">
		onload = print;
	</script> 
	
	<style>
		body {
			font-size: 12px;
			font-family: arial, helvetica, sans-serif;
			color: #000000;
		}
		
		h1 {
			font-size: 18px;
			text-transform: uppercase;
			text-align: center;
			margin-bottom: 15px;
		}
		
		h2 {
			font-size: 14px;
			text-transform: uppercase;
			letter-spacing: 2px;
			margin-bottom: 0px;
		}
		
		.section {
			border: 1px solid black;
			text-transform: uppercase;
			margin-bottom: 25px;
		}
		
		.section label {
			font-weight: bold;
			margin-right: 2px;
			margin-left: 15px;
		}
		
		.section p {
			height: 8px;
		}
</style>
</head>

<body>

<div id="content">

<h1>${inspection.inspector.company.name}<br />Inspection Order</h1>

<h2>Price and Time</h2>
<div class="section">
	<p>
	<label>Inspection Date:</label> ${inspection.inspectionTime?string("MM/dd/yyyy")}
	<label>Day:</label> ${inspection.inspectionTime?string("EEEE")}
	<label>Time:</label> ${inspection.inspectionTime?string("h:mm a")}
	</p>
	
	<p>
	<label>Inspector:</label> ${inspection.inspector.name}
	<label>Fee:</label>
	<#if (inspection.enteredInspectionFee > 0) >	
		${inspection.enteredInspectionFee?string.currency}
	<#else>
		${inspection.inspectionFee?string.currency}
	</#if>
	
	<label>Status:</label> ${inspection.inspectionStatus}
	</p>
</div>

<h2>Customer Information</h2>
<div class="section">
	<p>
	<label>Name:</label>
	${inspection.homeBuyer.name}
	
	<label>Contact #:</label>
	${(inspection.homeBuyer.phone)!}
	</p>
	
	<p>
	<label>Address:</label>
	${(inspection.homeBuyer.address.street1)!}
	
	<label>City:</label>
	${(inspection.homeBuyer.address.city)!}
	
	<label>State:</label>
	${(inspection.homeBuyer.address.state.longName)!}
	
	<label>Zip:</label>
	${(inspection.homeBuyer.address.zipCode)!}
	</p>
	
	<p>
	<label>Additional #:</label>
	${(inspection.homeBuyer.secondaryPhone)!}
	
	<label>Email:</label>
	${inspection.homeBuyer.email}
	
	<label>Fax:</label>
	${(inspection.homeBuyer.fax)!}
	</p>
</div>

<h2>Second Customer Information</h2>
<div class="section">
	<p>
	<label>Name:</label>
	${(inspection.secondHomeBuyer.name)!}

	<label>Contact #:</label>
	${(inspection.secondHomeBuyer.phone)!}
	</p>

	<p>
	<label>Email:</label>
	${(inspection.secondHomeBuyer.email)!}
	</p>
</div>	


<h2>Property Information</h2>
<div class="section">
	<p>
	<label>Address:</label>
	${(inspection.property.location.street1)!}
	
	<label>City:</label>
	${(inspection.property.location.city)!}
	
	<label>Zip:</label>
	${(inspection.property.location.zipCode)!}
	</p>
	
	<p>
	<label>Cross St:</label>
	${(inspection.property.crossStreet)!}
	
	<label>Subdivision:</label>
	${(inspection.property.subdivisionName)!}
	</p>
	
	<p>
	<label>Occupied:</label>
	${inspection.property.occupied?string("yes", "no")}
	
	<label>Lockbox:</label>
	${(inspection.lockboxType)!}
	
	<label>CBS Code:</label>
	${(inspection.lockboxRealtorCode)!}
	
	<label>Type:</label>
	${(inspection.property.propertyType)!}
	</p>
	
	<p>
	<label>Electric:</label>
	${inspection.electricityExpectedToBeOn?string("on", "off")}
	
	<label>Gas:</label>
	${inspection.gasExpectedToBeOn?string("on", "off")}
	
	<label>Water:</label>
	${inspection.waterExpectedToBeOn?string("on", "off")}
	
	<label>Foundation:</label>
	${(inspection.property.foundationType)!}
	</p>
	
	<p>
	<label>Stories:</label>
	${inspection.property.numberOfStories}
	
	<label>Age of House:</label>
	<#if (inspection.property.constructionYear > 0) >
		${inspection.property.ageInYears?string("####")} yrs
	</#if>
	
	<label>Other Structures:</label>
		${(inspection.property.otherStructures)!}
	</p>
</div>

<h2>Listing Information</h2>
<div class="section">
	<p>
	<label>Price:</label>
	${(inspection.property.listedPrice?string.currency)!}
	
	<label># Bdrms:</label>
	${(inspection.property.numberOfBedrooms)!}
	
	<label># Baths:</label>
	${inspection.property.numberOfBathrooms}
	
	<label># AC Units:</label>
	<#if inspection.property.numberOfAcUnits==-1>
		Don't know
	<#else>
		${inspection.property.numberOfAcUnits}
	</#if>
	
	<label>Present for Inspection:</label>
	${(inspection.presentAtInspection)!}
	</p>
	
	<#if inspection.inspector.company.optionalServices?? && (inspection.inspector.company.optionalServices?size > 0)>
	<p>
		<label>Addtl Services:</label>
		<#if inspection.optionalServices?? && (inspection.optionalServices?size > 0)>
			<#list inspection.optionalServices as optionalService>
				${optionalService.title} (${optionalService.price?string.currency})
				
				<#if optionalService_index < (inspection.optionalServices?size - 1)>
				,&nbsp;&nbsp;
				</#if>				
			</#list>
		<#else>
			None
		</#if>
	</p>
	</#if>
</div>

<h2>Listing Agent Information</h2>
<div class="section">
	<p>
	<label>Agent Name:</label>
	${(inspection.listingAgentName)!}
	
	<label>Agent Phone Number:</label>
	${(inspection.listingAgentPhoneNumber)!}
	</p>
</div>

<h2>Referring Agent Information</h2>
<div class="section">
	<p>
		<label>Agent:</label>
		${(inspection.referringAgent.name)!}
		
		<label>Company:</label>
		${(inspection.referringAgent.company)!}
		
		<#if inspection.referringAgent?? && inspection.referringAgent.office??>
			<label>Office:</label>
			${(inspection.referringAgent.office)!}
		</#if>
		
	</p>
	<p>
		<label>Phone:</label>
		${(inspection.referringAgent.cellPhone)!}
		
		<label>Email:</label>
		${(inspection.referringAgent.email)!}
	</p>
</div>

<div class="section">
	<p>
		<label>Directions/Special Instructions:</label> ${inspection.comments!}
	</p>
</div>

</body>
</html>